import {get, post, del, put} from "@/apis/http/request";
import {Menu} from "@/apis/model/system/MenuModel";

/**
 * 得到菜单列表
 * @param params
 */
export const getMenuList = (params: any) => get("/menu/menuListTree", params)

/**
 * 得到菜单分页列表
 * @param params
 */
export const menuPage = (params: any) => post("/menu/page", params)


/**
 * 循环获取权限
 * @returns 
 */
export const menuLoop = (params: any) => post("/menu/loopList", params)

/**
 * 删除数据
 * @param id 
 * @returns 
 */
export const deleteMenuById = (id: number) => del("/menu/delete/"+ id)

/**
 * 新增数据
 * @param param
 */
export const insertMenu = (param: Menu) => post("/menu", param)

/**
 * 更新数据
 * @param param
 */
export const updateMenu = (param: Menu) => put("/menu", param)